{"ast":null,"code":"import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getContainer(container) {\n  return typeof container === 'function' ? container() : container;\n}\n\n/**\n * Portals provide a first-class way to render children into a DOM node\n * that exists outside the DOM hierarchy of the parent component.\n */\nconst Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {\n  const {\n    children,\n    container,\n    disablePortal = false\n  } = props;\n  const [mountNode, setMountNode] = React.useState(null);\n  const handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, ref);\n  useEnhancedEffect(() => {\n    if (!disablePortal) {\n      setMountNode(getContainer(container) || document.body);\n    }\n  }, [container, disablePortal]);\n  useEnhancedEffect(() => {\n    if (mountNode && !disablePortal) {\n      setRef(ref, mountNode);\n      return () => {\n        setRef(ref, null);\n      };\n    }\n    return undefined;\n  }, [ref, mountNode, disablePortal]);\n  if (disablePortal) {\n    if ( /*#__PURE__*/React.isValidElement(children)) {\n      return /*#__PURE__*/React.cloneElement(children, {\n        ref: handleRef\n      });\n    }\n    return children;\n  }\n  return /*#__PURE__*/_jsx(React.Fragment, {\n    children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? Portal.propTypes /* remove-proptypes */ = {\n  // ----------------------------- Warning --------------------------------\n  // | These PropTypes are generated from the TypeScript type definitions |\n  // |     To update them edit the d.ts file and run \"yarn proptypes\"     |\n  // ----------------------------------------------------------------------\n  /**\n   * The children to render into the `container`.\n   */\n  children: PropTypes.node,\n  /**\n   * An HTML element or function that returns one.\n   * The `container` will have the portal children appended to it.\n   *\n   * By default, it uses the body of the top-level document object,\n   * so it's simply `document.body` most of the time.\n   */\n  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),\n  /**\n   * The `children` will be under the DOM hierarchy of the parent component.\n   * @default false\n   */\n  disablePortal: PropTypes.bool\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n  // eslint-disable-next-line\n  Portal['propTypes' + ''] = exactProp(Portal.propTypes);\n}\nexport default Portal;","map":{"version":3,"names":["React","ReactDOM","PropTypes","exactProp","HTMLElementType","unstable_useEnhancedEffect","useEnhancedEffect","unstable_useForkRef","useForkRef","unstable_setRef","setRef","jsx","_jsx","getContainer","container","Portal","forwardRef","props","ref","children","disablePortal","mountNode","setMountNode","useState","handleRef","isValidElement","document","body","undefined","cloneElement","Fragment","createPortal","process","env","NODE_ENV","propTypes","node","oneOfType","func","bool"],"sources":["/data/messenger.client/node_modules/@mui/lab/node_modules/@mui/base/Portal/Portal.js"],"sourcesContent":["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getContainer(container) {\n  return typeof container === 'function' ? container() : container;\n}\n\n/**\n * Portals provide a first-class way to render children into a DOM node\n * that exists outside the DOM hierarchy of the parent component.\n */\nconst Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {\n  const {\n    children,\n    container,\n    disablePortal = false\n  } = props;\n  const [mountNode, setMountNode] = React.useState(null);\n  const handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, ref);\n  useEnhancedEffect(() => {\n    if (!disablePortal) {\n      setMountNode(getContainer(container) || document.body);\n    }\n  }, [container, disablePortal]);\n  useEnhancedEffect(() => {\n    if (mountNode && !disablePortal) {\n      setRef(ref, mountNode);\n      return () => {\n        setRef(ref, null);\n      };\n    }\n    return undefined;\n  }, [ref, mountNode, disablePortal]);\n  if (disablePortal) {\n    if ( /*#__PURE__*/React.isValidElement(children)) {\n      return /*#__PURE__*/React.cloneElement(children, {\n        ref: handleRef\n      });\n    }\n    return children;\n  }\n  return /*#__PURE__*/_jsx(React.Fragment, {\n    children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? Portal.propTypes /* remove-proptypes */ = {\n  // ----------------------------- Warning --------------------------------\n  // | These PropTypes are generated from the TypeScript type definitions |\n  // |     To update them edit the d.ts file and run \"yarn proptypes\"     |\n  // ----------------------------------------------------------------------\n  /**\n   * The children to render into the `container`.\n   */\n  children: PropTypes.node,\n  /**\n   * An HTML element or function that returns one.\n   * The `container` will have the portal children appended to it.\n   *\n   * By default, it uses the body of the top-level document object,\n   * so it's simply `document.body` most of the time.\n   */\n  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),\n  /**\n   * The `children` will be under the DOM hierarchy of the parent component.\n   * @default false\n   */\n  disablePortal: PropTypes.bool\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n  // eslint-disable-next-line\n  Portal['propTypes' + ''] = exactProp(Portal.propTypes);\n}\nexport default Portal;"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAO,KAAKC,QAAQ,MAAM,WAAW;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,EAAEC,eAAe,EAAEC,0BAA0B,IAAIC,iBAAiB,EAAEC,mBAAmB,IAAIC,UAAU,EAAEC,eAAe,IAAIC,MAAM,QAAQ,YAAY;AACtK,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,CAACC,SAAS,EAAE;EAC/B,OAAO,OAAOA,SAAS,KAAK,UAAU,GAAGA,SAAS,EAAE,GAAGA,SAAS;AAClE;;AAEA;AACA;AACA;AACA;AACA,MAAMC,MAAM,GAAG,aAAaf,KAAK,CAACgB,UAAU,CAAC,SAASD,M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